package View

import ControllerView.ControllerView
import com.trolltech.qt.gui._
import com.trolltech.qt.core.QSize

/**
 * Created by IntelliJ IDEA.
 * User: danymorard
 * Date: 14.04.11
 * Time: 20:44
 * To change this template use File | Settings | File Templates.
 */

class ToolsWindow(controller: ControllerView, parent: QWidget) extends View(controller, parent) {

  /**
   * Size of the window
   */
  protected val WINDOW_SIZE = new QSize(700, 500)

    /**
   * Background image
   */
  var backgroundImage = new QLabel(this)

  protected var toolBar = new QToolBar(this)
  protected var actionKeyManage = new QAction(new QIcon(PATH_PICTURE + "keyIcon.png"), tr("Key"), this)
  protected var actionSoftManage = new QAction(new QIcon(PATH_PICTURE + "setupIcon.png"), tr("Soft"), this)

  var buttonOkay = new QPushButton(this)
  var buttonCancel = new QPushButton(this)


  this.initView


  protected def initView {



   // this.setGeometry(100,100,WINDOW_SIZE.width, WINDOW_SIZE.height)
    this.setFixedSize(WINDOW_SIZE)
    this.setWindowTitle("Tools")

    this.android.hide



    backgroundImage.setPixmap(new QPixmap(PATH_PICTURE + "backgroundTools.jpg"))
    backgroundImage.setGeometry(0,0,WINDOW_SIZE.width,WINDOW_SIZE.height)

    buttonCancel.setGeometry(20, 465, SMALL_BUTTON_SIZE.width, SMALL_BUTTON_SIZE.height)
    buttonCancel.setText("Cancel")
    buttonCancel.setObjectName(CSS_SMALL_BUTTON)


    buttonOkay.setGeometry(555, 465, 120, SMALL_BUTTON_SIZE.height)
    buttonOkay.setText("Save and close")
    buttonOkay.setObjectName(CSS_SMALL_BUTTON)
    buttonOkay.clicked.connect(controller, "applyPressed()")


    actionKeyManage.triggered.connect(controller, "keyActionButtonPressed()")
    actionSoftManage.triggered.connect(controller, "softActionButtonPressed()")


    toolBar.setGeometry(0, 0, 700, 40)
    toolBar.addAction(actionKeyManage)
    toolBar.addAction(actionSoftManage)
  }
}